<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
require_once __DIR__ . "/../autoload.php";
$accessKey = getenv("QINIU_ACCESS_KEY");
$secretKey = getenv("QINIU_SECRET_KEY");
$bucket = getenv("QINIU_TEST_BUCKET");
$auth = new Qiniu\Auth($accessKey, $secretKey);
$policy = ["callbackUrl" => "http://your.domain.com/upload_verify_callback.php", "callbackBody" => "filename=\$(fname)&filesize=\$(fsize)"];
$uptoken = $auth->uploadToken($bucket, NULL, 3600, $policy);
$filePath = "./php-logo.png";
$uploadMgr = new Qiniu\Storage\UploadManager();
list($ret, $err) = $uploadMgr->putFile($uptoken, NULL, $filePath);
echo "\n====> putFile result: \n";
if($err !== NULL) {
    var_dump($err);
} else {
    var_dump($ret);
}

?>